<template>
  <div class="order">
    <div class="order_left">
      <img src="~@/assets/screen/gongdan-img.png" />
    </div>
    <div class="order_right">
      <div v-for="(item, index) in orderList"
           :key="item.name"
           class="order_option">
        <img :src="require('@/assets/screen/gongdan' + (index + 1) + '.png')"
             class="order_img" />
        <div class="order_option_content">
          <span class="order_value">{{ item.value }}</span>
          <span class="order_label"
                :style="{color:item.color}">{{ item.name }}</span>
        </div>
      </div>
    </div>
    <!-- <div v-for="item in orderList"
         :key="item.name">
      {{item.name}} : {{item.value}}
    </div> -->
  </div>
</template>
<script>
export default {
  data() {
    return {
      orderList: [
        { name: '待处理报警', value: 123, color: 'red' },
        { name: '已处理报警', value: 456, color: '#00da00' },
        { name: '已派单', value: 989, color: '#00b8ff' }
      ]
    }
  },
  created() {
    // this.totalAlert()
  },
  methods: {
    totalAlert() {
      this.$get('console/api/v1/cockpit/total-alert').then(r => {
        const data = r.data.data
        this.orderList = [
          { name: '待处理报警', value: data.totalPendingAlarms },
          { name: '已处理报警', value: data.totalResolved },
          { name: '已派单', value: data.totalOrderSent }
        ]
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.order {
  width: 100%;
  height: 100%;
  color: #fff;
  display: flex;
  align-items: center;
}
.order_left {
  height: 100%;
  width: 40%;
  padding-top: 5%;
}
.order_right {
  height: 100%;
  width: 50%;
  line-height: 4;
  padding-top: 5%;
}
.order_option {
  position: relative;
}
.order_option_content {
  position: absolute;
  top: -27px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.order_img {
  width: 100%;
  height: 100%;
}
.order_value {
  font-size: 24px;
  font-family: Lcd;
  text-shadow: 0px 0px 10px #ffffff9e, 0px 0px 20px #ffffff9e,
    0px 0px 30px #ffffff9e, 0px 0px 40px #ffffff9e;
}
.order_label {
  font-size: 18px;
  width: 100px;
  text-align: center;
}
</style>
